﻿using System;
using System.Collections.Generic;
using System.Web;
using DataAccess;
using System.Data;
/// <summary>
/// Summary description for SchoolofYearBS
/// </summary>
public class SchoolofYearBS 
{
    SchoolofYearDAO sy;
    public SchoolofYearBS()
    {
        sy = new SchoolofYearDAO();
        //
        // TODO: Add constructor logic here
        //
    }
    public List<SchoolofYear> ShowSchoolofYear()
    {
        DataTable tbl = sy.ShowSchoolofYear();
        List<SchoolofYear> list = new List<SchoolofYear>();
        foreach (DataRow row in tbl.Rows)
        {
            SchoolofYear SY = new SchoolofYear(int.Parse(row[0].ToString()), row[1].ToString());
            list.Add(SY);
        }
        return list;
    }
    public int CodeSchoolofYear(string NameSchoolofYear)
    {
        int code = sy.CodeSchoolofYear(NameSchoolofYear);
        return code;
    }
}